import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;


public class Main {
	public static void main(String[] args) {
		final Tracker track = new Tracker();
		track.setLocation("KKK", 56, 89);
		track.setLocation("KKK1", 57, 89);
		track.setLocation("KKK2", 58, 89);
		track.setLocation("KKK3", 59, 89);
		track.setLocation("KKK4", 60, 89);
		new Thread() {
			public void run() {
				try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				Point point = track.getLocation("KKK2");
				System.out.println(point.getX()+" "+point.getY());
			}
		}.start();
		new Thread() {
			public void run() {
				try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				Point point = track.getLocation("KKK2");
				System.out.println(point.getX()+" "+point.getY());
			}
		}.start();
		new Thread() {
			public void run() {
				Map<String, Point> map = track.getLocations();
				Iterator iter = map.entrySet().iterator();
				while (iter.hasNext()) {
					System.out.println(iter.next());
				}
			}
		}.start();
	}
}

